<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>异常捕获</title>
	</head>
	<body>
       
         <script>
             var str="hello";
         function demo(){
            try{
                alert(str);
            }catch(err){
                alert(err);
            }
         }
         demo();
         </script>
	</body>
</html>
